<template>
  <div class="mx-container">
    <zz-sub-nav :list="list" :index.sync="index">
      <div class="sub-nav-content">
        <div>
          <div class="details-title">{{ $t("zz.access_scenario") }}</div>
          <p></p>
          <div style="height: 20px"></div>
          <img :src="require('@/assets/img/live/live1-1.png')" alt="" />
        </div>
        <div>
          <div class="details-title">{{ $t("zz.product_superiority") }}</div>
          <div class="flex-2">
            <div class="flex-2-item" v-for="(it, i) in list1" :key="i">
              <sim-card :title="it.title" :content="it.content">
                <i
                  :class="`iconfont icon-${it.icon}`"
                  :style="`font-size:20px;color:${it.color};`"
                  slot="icon"
                ></i>
              </sim-card>
            </div>
          </div>
          <!-- <img
            :src="require('@/assets/img/live/live2-1.png')"
            alt=""
          /> -->
        </div>
        <div>
          <div class="details-title">{{ $t("zz.product_function") }}</div>

          <div class="flex-2">
            <div class="flex-2-item" v-for="(it, i) in list2" :key="i">
              <sim-card :title="it.title" :content="it.content"></sim-card>
            </div>
          </div>
          <!-- <img :src="require('@/assets/img/live/live3-1.png')" alt="" /> -->
        </div>
        <div class="content-sub-nav-wrap">
          <div class="details-title">{{ $t("zz.application_scenarios") }}</div>
          <div class="header-nav-wrapper-wrap">
            <ul class="header-nav-wrapper SpaceB" style="width: 650px">
              <li
                v-for="(item, i) in list[3].child"
                :key="i"
                :class="item.index == subIndex ? 'active' : ''"
                @click="navClick(item)"
              >
                {{ item.name }}
              </li>
            </ul>
          </div>
          <div v-if="subIndex == 1">
            <zz-card position="left">
              <div slot="content" class="card-wrap">
                <h6 class="list-title">{{ $t("zz.access_scenario") }}</h6>
                <ul class="list-has-poi">
                  <li>{{ $t("zz.realTime.video.des.1.1") }}</li>
                  <li>{{ $t("zz.realTime.video.des.1.2") }}</li>
                  <li>{{ $t("zz.realTime.video.des.1.3") }}</li>
                </ul>
              </div>
              <img
                src="@/assets/img/live/live4-1.png"
                slot="img"
                alt=""
                width="420"
              />
            </zz-card>
          </div>
          <div v-if="subIndex == 2">
            <zz-card position="left">
              <div slot="content" class="card-wrap">
                <h6 class="list-title">{{ $t("zz.access_scenario") }}</h6>
                <ul class="list-has-poi">
                  <li>{{ $t("zz.realTime.video.des.2.1") }}</li>
                  <li>{{ $t("zz.realTime.video.des.2.2") }}</li>
                  <li>{{ $t("zz.realTime.video.des.2.3") }}</li>
                </ul>
              </div>
              <img
                src="@/assets/img/live/live4-2.png"
                slot="img"
                alt=""
                width="420"
              />
            </zz-card>
          </div>
          <div v-if="subIndex == 3">
            <zz-card position="left">
              <div slot="content" class="card-wrap">
                <h6 class="list-title">{{ $t("zz.access_scenario") }}</h6>
                <ul class="list-has-poi">
                  <li>{{ $t("zz.realTime.video.des.3.1") }}</li>
                  <li>{{ $t("zz.realTime.video.des.3.2") }}</li>
                </ul>
              </div>
              <img
                src="@/assets/img/live/live4-3.png"
                slot="img"
                alt=""
                width="420"
              />
            </zz-card>
          </div>
          <div v-if="subIndex == 4">
            <zz-card position="left">
              <div slot="content" class="card-wrap">
                <h6 class="list-title">{{ $t("zz.access_scenario") }}</h6>
                <ul class="list-has-poi">
                  <li>{{ $t("zz.realTime.video.des.4.1") }}</li>
                  <li>{{ $t("zz.realTime.video.des.4.2") }}</li>
                </ul>
              </div>
              <img
                src="@/assets/img/live/live4-4.png"
                slot="img"
                alt=""
                width="420"
              />
            </zz-card>
          </div>
          <div v-if="subIndex == 5">
            <zz-card position="left">
              <div slot="content" class="card-wrap">
                <h6 class="list-title">{{ $t("zz.access_scenario") }}</h6>
                <ul class="list-has-poi">
                  <li>{{ $t("zz.realTime.video.des.5.1") }}</li>
                  <li>{{ $t("zz.realTime.video.des.5.2") }}</li>
                  <li>{{ $t("zz.realTime.video.des.5.3") }}</li>
                </ul>
              </div>
              <img
                src="@/assets/img/live/live4-5.png"
                slot="img"
                alt=""
                width="420"
              />
            </zz-card>
          </div>
          <div v-if="subIndex == 6">
            <zz-card position="left">
              <div slot="content" class="card-wrap">
                <h6 class="list-title">{{ $t("zz.access_scenario") }}</h6>
                <ul class="list-has-poi">
                  <li>{{ $t("zz.realTime.video.des.6.1") }}</li>
                  <li>{{ $t("zz.realTime.video.des.6.2") }}</li>
                  <li>{{ $t("zz.realTime.video.des.6.3") }}</li>
                </ul>
              </div>
              <img
                src="@/assets/img/live/live4-6.png"
                slot="img"
                alt=""
                width="420"
              />
            </zz-card>
          </div>
          <div v-if="subIndex == 7">
            <zz-card position="left">
              <div slot="content" class="card-wrap">
                <h6 class="list-title">{{ $t("zz.access_scenario") }}</h6>
                <ul class="list-has-poi">
                  <li>{{ $t("zz.realTime.video.des.7.1") }}</li>
                  <li>{{ $t("zz.realTime.video.des.7.2") }}</li>
                </ul>
              </div>
              <img
                src="@/assets/img/live/live4-7.png"
                slot="img"
                alt=""
                width="420"
              />
            </zz-card>
          </div>
        </div>
      </div>
    </zz-sub-nav>
  </div>
</template>

<script>
import SubNav from "@/components/SubNav/index.vue";
import ZzCard from "@/components/ZzCard";
import SimCard from "@/components/SimCard";
import { mapGetters } from "vuex";

export default {
  data() {
    return {
      index: 1,
      subIndex: 1,
    };
  },

  components: {
    "zz-sub-nav": SubNav,
    ZzCard,
    SimCard,
  },
  props: {},
  mounted() {},
  computed: {
    activeItem: function () {
      let activeItem = this.list.find((v) => v.index == this.index);
      console.log(this.list[this.index]);
      this.subIndex = activeItem.child ? activeItem.child[0].index : 1;
      return activeItem;
    },
    ...mapGetters({
      isPC: "isPC",
    }),
    list: function () {
      return [
        {
          name: this.$t("zz.product_presentation"),
          index: 1,
          title: this.$t("zz.product_presentation"),
        },
        { name: this.$t("zz.product_superiority"), index: 2 },
        { name: this.$t("zz.product_function"), index: 3 },
        {
          name: this.$t("zz.application_scenarios"),
          index: 4,
          child: [
            {
              name: this.$t("zz.realTime.application.title1"),
              index: 1,
              pcname: this.$t("zz.realTime.application.title1.little"),
            },
            {
              name: this.$t("zz.realTime.application.title2"),
              index: 2,
              pcname: this.$t("zz.realTime.application.title2.little"),
            },
            {
              name: this.$t("zz.realTime.application.title3"),
              index: 3,
              pcname: this.$t("zz.realTime.application.title3.little"),
            },
            {
              name: this.$t("zz.realTime.application.title4"),
              index: 4,
              pcname: this.$t("zz.realTime.application.title4.little"),
            },
            {
              name: this.$t("zz.realTime.application.title5"),
              index: 5,
              pcname: this.$t("zz.realTime.application.title5.little"),
            },
            {
              name: this.$t("zz.realTime.application.title6"),
              index: 6,
              pcname: this.$t("zz.realTime.application.title6.little"),
            },
            {
              name: this.$t("zz.realTime.application.title7"),
              index: 7,
              pcname: this.$t("zz.realTime.application.title7.little"),
            },
          ],
        },
      ];
    },
    list1: function () {
      return [
        {
          title: this.$t("zz.realTime.video.advantage.title1"),
          content: this.$t("zz.realTime.video.advantage.intro1"),
          icon: "diqiu",
          color: "#92ADFF",
        },
        {
          title: this.$t("zz.realTime.video.advantage.title2"),
          content: this.$t("zz.realTime.video.advantage.intro2"),
          icon: "yibiao",
          color: "#92ADFF",
        },
        {
          title: this.$t("zz.realTime.video.advantage.title3"),
          content: this.$t("zz.realTime.video.advantage.intro3"),
          icon: "xinhao",
          color: "#92ADFF",
        },
        {
          title: this.$t("zz.realTime.video.advantage.title4"),
          content: this.$t("zz.realTime.video.advantage.intro4"),
          icon: "huiyi",
          color: "#92ADFF",
        },
      ];
    },
    list2: function () {
      return [
        {
          title: this.$t("zz.realTime.video.function.title1"),
          content: this.$t("zz.realTime.video.function.intro1"),
        },
        {
          title: this.$t("zz.realTime.video.function.title2"),
          content: this.$t("zz.realTime.video.function.intro2"),
        },
        {
          title: this.$t("zz.realTime.video.function.title3"),
          content: this.$t("zz.realTime.video.function.intro3"),
        },
        {
          title: this.$t("zz.realTime.video.function.title4"),
          content: this.$t("zz.realTime.video.function.intro4"),
        },
        {
          title: this.$t("zz.realTime.video.function.title5"),
          content: this.$t("zz.realTime.video.function.intro5"),
        },
        {
          title: this.$t("zz.realTime.video.function.title6"),
          content: this.$t("zz.realTime.video.function.intro6"),
        },
        {
          title: this.$t("zz.realTime.video.function.title7"),
          content: this.$t("zz.realTime.video.function.intro7"),
        },
        {
          title: this.$t("zz.realTime.video.function.title8"),
          content: this.$t("zz.realTime.video.function.intro8"),
        },
      ];
    },
  },
  watch: {},
  methods: {
    navClick(a_item) {
      console.log(a_item);
      this.subIndex = a_item.index;
    },
  },
  destroyed() {},
};
</script>
<style lang='scss' scoped>
@import "@/style/variables.scss";

.sub-nav-content {
  padding: 12px 48px;
  flex: 1;
  width: 100%;
  .pro-title {
    color: $color;
    font-size: 20px;
    padding: 20px 45px;
    border-bottom: 1px solid $border;
  }
  .pro-intro-wrap {
    padding: 30px 48px;
  }
  img {
    max-width: 100%;
  }
}
.son-pro-wrap {
  display: flex;
  justify-content: space-between;
  margin-top: 48px;
  & > div {
    width: 238px;
  }
}
.pro-pailie-wrap {
  .card-wrap {
    margin-top: 30px;
    display: flex;
    flex-wrap: wrap;
    & > div {
      width: 40%;
      margin: 0 5% 30px;
      img {
        margin-top: 0;
        width: 32px;
        margin-right: 10px;
      }
      h6 {
        font-size: 18px;
        font-weight: normal;
        line-height: 32px;
        margin: 10px 0 15px;
      }
      p {
        font-size: 14px;
        line-height: 25px;
      }
    }
  }
}
.business-wrap {
  padding: 50px 25px;
  h6 {
    font-size: 16px;
    margin: 50px 0 25px;
  }
  ul {
    padding-left: 25px;
    li {
      color: rgba(59, 59, 59, 1);
      font-size: 14px;
      line-height: 200%;
    }
  }
  p {
    font-size: 14px;
  }
}
</style>